using Assets.Scripts.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class UICharacterPool_Item : MonoBehaviour, IPointerClickHandler
{
    public Image CardImage;

    private bool isSelect;
    public bool IsSelect
    {
        get => isSelect;

        set
        {
            isSelect = value;
            if (isSelect)
            {
                CardImage.transform.localPosition = new Vector3(0, 100, 0);
            }
            else
            {
                CardImage.transform.localPosition = Vector3.zero;
            }
        }
    }

    public int cardID;

    public void Init(int cardID, CardDefine cardDefine)
    {
        this.cardID = cardID;
        CardImage.sprite = cardDefine.cardImage;
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        UICharacterPool_Panel.Instance.SelectCharacterCard(cardID);
    }
}
